<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>文件上传</title>
    <link href="css/iconfont.css" rel="stylesheet" type="text/css"/>
    <link href="css/fileUpload.css" rel="stylesheet" type="text/css">
</head>
<body>
    <div id="fileUploadContent" class="fileUploadContent">
        <!--<div class="uploadBts">
            <div>
                <div class="selectFileBt">选择文件</div>
            </div>
            <div>
            <i class="iconfont icon-shangchuan"></i>
            </div>
        </div>
        <div class="subberProgress">
            <div class="progress">
                <div>30%</div>
            </div>
        </div>
        <div class="box">
            <div class="fileItem">
                <div class="imgShow">
                    <div class="fileType">txt</div>
                    <i class="iconfont icon-wenjian"></i>
                </div>
                <div class="progress">
                    <div class="progress_inner error"></div>
                </div>
                <div class="status">
                    <i class="iconfont icon-shanchu"></i>
                </div>
                <div class="fileName">
                   qwertyuiopasdfghjklzxcvbnm.jpg
                </div>
            </div>
            <div class="fileItem">
                <div class="imgShow">
                    <div class="fileType">jpg</div>
                    <i class="iconfont icon-wenjian"></i>
                </div>
                <div class="progress">
                    <div class="progress_inner error"></div>
                </div>
                <div class="status">
                    <i class="iconfont icon-shanchu"></i>
                </div>
                <div class="fileName">
                    qwertyuiopasdfghjklzxcvbnm.jpg
                </div>
            </div>
            <div class="fileItem">
                <div class="imgShow">
                    <img src="404bg.jpg"/>
                </div>
                <div class="progress">
                    <div class="progress_inner error"></div>
                </div>
                <div class="status">
                    <i class="iconfont icon-shanchu"></i>
                </div>
                <div class="fileName">
                    qwertyuiopasdfghjklzxcvbnm.jpg
                </div>
            </div>

        </div>-->

    </div>
</body>
</html>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="js/fileUpload.js"></script>
<script type="text/javascript">
    $("#fileUploadContent").initUpload({
        "uploadUrl":"#",//上传文件信息地址
        "progressUrl":"#",//获取进度信息地址，可选，注意需要返回的data格式如下（{bytesRead: 102516060, contentLength: 102516060, items: 1, percent: 100, startTime: 1489223136317, useTime: 2767}）
        //"showSummerProgress":false,//总进度条，默认限制
        //"size":350,//文件大小限制，单位kb,默认不限制
        //"maxFileNumber":3,//文件个数限制，为整数
        //"filelSavePath":"",//文件上传地址，后台设置的根目录
        //"beforeUpload":beforeUploadFun,//在上传前执行的函数
        //"onUpload":onUploadFun，//在上传后执行的函数
        autoCommit:false,//文件是否自动上传
        //"fileType":['png','jpg','docx','doc']，//文件类型限制，默认不限制，注意写的是文件后缀
    })
    function beforeUploadFun(opt){
        opt.otherData =[{"name":"你要上传的参数","value":"你要上传的值"}];
    }
    function onUploadFun(opt,data){
        alert(data);
        uploadTools.uploadError(opt);//显示上传错误
    }
</script>